# 需求：打开‘注册A.html’页面，完成以下操作
# 1). 填写注册信息
# 2). 截图保存
import time
from time import sleep
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Chrome(executable_path='chromedriver.exe')
# # 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")

# 1). 填写注册信息
driver.find_element_by_css_selector("#userA").send_keys("admin")
# 动态获取文件名称，使用时间戳
driver.get_screenshot_as_file("../img/{}.png".format(time.strftime("%Y_%m_%d_%H_%M_%S")))

# sleep(3)
# driver.quit()